package com.make.house.api;

import com.make.house.api.filter.GlobalFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xujun on 2017/11/2.
 * boot启动的主方法
 */
@SpringBootApplication
@EnableScheduling
public class VideoExamApplication {
    public static void main(String[] args) {
        SpringApplication.run(VideoExamApplication.class, args);
//        SpringApplication application = new SpringApplication(App.class);
//        application.setBannerMode(Banner.Mode.OFF);
//        application.run(args);
    }

    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        GlobalFilter globalFilter = new GlobalFilter();
        registrationBean.setFilter(globalFilter);
        List<String> urlPatterns = new ArrayList<String>();
        urlPatterns.add("/*");
        registrationBean.setUrlPatterns(urlPatterns);
        return registrationBean;
    }
}
